home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Rename
- BackColor = &H00FFFFFF&
- BorderStyle = 3 'Fixed Double
- Caption = "Rename"
- ClientHeight = 5070
- ClientLeft = 2040
- ClientTop = 1380
- ClientWidth = 8700
- ControlBox = 0 'False
- Height = 5475
- KeyPreview = -1 'True
- Left = 1980
- LinkTopic = "Form1"
- ScaleHeight = 5070
- ScaleWidth = 8700
- Top = 1035
- Width = 8820
- Begin CheckBox RenameDir
- Caption = "Rename Directory"
- Height = 375
- Left = 2640
- TabIndex = 4
- Top = 4200
- Width = 2175
- End
- Begin SSCommand Command3D1
- Caption = "About"
- Font3D = 1 'Raised w/light shading
- Height = 975
- Left = 6480
- TabIndex = 8
- Top = 2280
- Width = 975
- End
- Begin CommandButton Cancel
- Cancel = -1 'True
- Caption = "Quit"
- Height = 375
- Left = 7080
- TabIndex = 7
- Top = 1800
- Width = 1215
- End
- Begin CommandButton OK
- Caption = "OK"
- Height = 375
- Left = 5640
- TabIndex = 6
- Top = 1800
- Width = 1215
- End
- Begin TextBox Text2
- Height = 285
- Left = 5760
- MaxLength = 12
- TabIndex = 5
- Top = 600
- Width = 1935
- End
- Begin TextBox Text1
- Height = 285
- Left = 120
- MaxLength = 12
- TabIndex = 0
- Top = 600
- Width = 1935
- End
- Begin FileListBox File1
- Height = 2955
- Hidden = -1 'True
- Left = 120
- ReadOnly = 0 'False
- System = -1 'True
- TabIndex = 1
- Top = 960
- Width = 1935
- End
- Begin DirListBox Dir1
- Height = 2505
- Left = 2280
- TabIndex = 2
- Top = 960
- Width = 2175
- End
- Begin DriveListBox Drive1
- Height = 315
- Left = 120
- TabIndex = 3
- Top = 4440
- Width = 1935
- End
- Begin Label Label5
- Alignment = 2 'Center
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "If you find this program useful, please tell me. You can reach me on America On-Line as: Majerle09"
- ForeColor = &H00FF0000&
- Height = 1215
- Left = 5760
- TabIndex = 14
- Top = 3480
- Width = 2295
- End
- Begin Label Label4
- BackColor = &H00FFFFFF&
- Caption = "New Name:"
- Height = 255
- Left = 5760
- TabIndex = 13
- Top = 360
- Width = 1935
- End
- Begin Label Directory
- BackColor = &H00FFFFFF&
- ForeColor = &H00000000&
- Height = 255
- Left = 2280
- TabIndex = 12
- Top = 600
- Width = 2775
- End
- Begin Label Label3
- BackColor = &H00FFFFFF&
- Caption = "Drive:"
- Height = 255
- Left = 120
- TabIndex = 11
- Top = 4200
- Width = 1215
- End
- Begin Label Label2
- BackColor = &H00FFFFFF&
- Caption = "Directory:"
- Height = 255
- Left = 2280
- TabIndex = 10
- Top = 360
- Width = 1575
- End
- Begin Label Label1
- BackColor = &H00FFFFFF&
- Caption = "File Name:"
- Height = 255
- Left = 120
- TabIndex = 9
- Top = 360
- Width = 1095
- End
- Sub cancel_Click ()
- If Drive1.Drive <> App.Path Then ChDrive App.Path
- Call WriteProfileString("Rename", "RenameDirectory", (RenameDir.Value))
- Call WriteProfileString("Rename", "Version", "1.0")
- Unload Me
- End
- End Sub
- Sub Command1_Click ()
- About.Show 1
- End Sub
- Sub Command3D1_Click ()
- About.Show 1
- End Sub
- Sub Dir1_Change ()
- ChDir Dir1.Path
- File1.Path = Dir1.Path
- Directory.Caption = Dir1.Path
- End Sub
- Sub Drive1_Change ()
- ChDrive Drive1.Drive
- Dir1.Path = Drive1.Drive
- End Sub
- Sub File1_Click ()
- Text1.Text = File1.FileName
- Text1.Text = LCase(Text1.Text)
- End Sub
- Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_F1 Then About.Show 1
- End Sub
- Sub Form_Load ()
- Directory.Caption = Dir1.Path
- RenameDir.Value = GetProfileInt%("Rename", "RenameDirectory", 0)
- End Sub
- Sub OK_Click ()
- If Text1.Text = "" Then GoTo Nope
- If Text2.Text <> "" Then GoTo OK Else GoTo NO
- Text2.Text = LCase(Text2.Text)
- If Text1.Text = Text2.Text Then MsgBox "File already exists. Cannot rename.", 0 + 16, "File Already Exists": GoTo End1
- If File1.FileName = Text2.Text Then MsgBox "File already exists. Cannot rename.", 0 + 16, "File Already Exists": GoTo End1
- On Error GoTo FileHelper
- Start:
- Name Text1.Text As Text2.Text
- MsgBox UCase(Text1.Text) + " was renamed " + UCase(Text2.Text), 0 + 64, "Rename"
- GoTo End1
- FileHelper:
- MsgBox "There was an error renaming the file.", 0 + 16, "ERROR"
- GoTo Ends
- Nope:
- MsgBox "There was no file selected.", 0 + 16, "ERROR"
- GoTo End1
- MsgBox "There was no new name entered for " + UCase(Text1.Text), 0 + 16, "ERROR"
- GoTo End1
- Ends:
- If Drive1.Drive <> App.Path Then ChDrive App.Path
- Call WriteProfileString("Rename", "RenameDirectory", (RenameDir.Value))
- Call WriteProfileString("Rename", "Version", "1.0")
- Unload Me
- End
- End1:
- ChDir Dir1.Path
- File1.Path = Dir1.Path
- Directory.Caption = Dir1.Path
- Text1.Text = ""
- Text2.Text = ""
- End Sub
- Sub ShowHidden_Click (Value As Integer)
- End Sub
- Sub ShowSystem_Click (Value As Integer)
- End Sub
- Sub Text1_Change ()
- If Text1.Text = File1.FileName Then Text1.Text = File1.FileName
- If RenameDir.Value = 1 Then Text1.MaxLength = 0
- If RenameDir.Value = 0 Then Text1.MaxLength = 12
- End Sub
- Sub Text2_Change ()
- If RenameDir.Value = 1 Then Text2.MaxLength = 0
- If RenameDir.Value = 0 Then Text2.MaxLength = 12
- End Sub
- Sub Text3_Change ()
- End Sub
-